home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / include / incl98.zoo / linea.h < prev    next >
C/C++ Source or Header  |  1993-07-10  |  40KB  |  1,039 lines

  1. /*
  2.  * Common include file for C interface  to low level Line A calls
  3.  *
  4.  *    ++jrb    bammi@cadence.com
  5.  */
  6. #ifndef _LINEA_H
  7. #define _LINEA_H
  8.  
  9. #ifndef _COMPILER_H
  10. #include <compiler.h>
  11. #endif
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16.  
  17. /*****************************************************************************\
  18. *                                                                      *
  19. *                                 Defines                                     *
  20. *                                          *
  21. \*****************************************************************************/
  22.  
  23. /*
  24.  *  Object colors (default pallette)
  25.  *
  26.  */
  27. #define WHITE    0
  28. #define BLACK    1
  29. #define RED      2
  30. #define GREEN    3
  31. #define BLUE     4
  32. #define CYAN     5
  33. #define YELLOW   6
  34. #define MAGENTA  7
  35. #define LWHITE   8
  36. #define LBLACK   9
  37. #define LRED     10
  38. #define LGREEN   11
  39. #define LBLUE    12
  40. #define LCYAN    13
  41. #define LYELLOW  14
  42. #define LMAGENTA 15
  43.  
  44.  
  45. /* 
  46.  * Vdi writing modes
  47.  *
  48.  */
  49. #define MD_REPLACE 1
  50. #define MD_TRANS   2
  51. #define MD_XOR     3
  52. #define MD_ERASE   4
  53.  
  54.  
  55. /*
  56.  * Raster Op Codes
  57.  *
  58.  */
  59. #define ALL_WHITE  0
  60. #define S_AND_D    1
  61. #define    S_AND_NOTD 2
  62. #define S_ONLY     3
  63. #define NOTS_AND_D 4
  64. #define    D_ONLY     5
  65. #define S_XOR_D    6
  66. #define S_OR_D     7
  67. #define    NOT_SORD   8
  68. #define    NOT_SXORD  9
  69. #define D_INVERT  10
  70. #define    NOT_D     10
  71. #define    S_OR_NOTD 11
  72. #define NOT_S      12
  73. #define NOTS_OR_D 13
  74. #define    NOT_SANDD 14
  75. #define ALL_BLACK 15
  76.  
  77. /*
  78.  * Sprite formats
  79.  *
  80.  */
  81. #define SP_VDI        0
  82. #define SP_XOR        1
  83.  
  84. /*
  85.  * Line A Opcodes
  86.  *
  87.  */
  88. #define    INIT        0
  89. #define PUTPIXEL    1
  90. #define GETPIXEL    2
  91. #define LINE        3
  92. #define HLINE        4
  93. #define RECTANGLE    5
  94. #define FPOLYGON    6
  95. #define BITBLT        7
  96. #define TEXTBLT        8
  97. #define SHOWMOUSE    9
  98. #define HIDEMOUSE    10
  99. #define TRANMOUSE    11
  100. #define USPRITE        12
  101. #define DSPRITE        13
  102. #define CPYRASTER    14
  103. #define FSEEDFILL    15    /* ROM TOS only    */
  104.  
  105.  
  106. /*****************************************************************************\
  107. *                                                                      *
  108. *                                 Types                                       *
  109. *                                          *
  110. \*****************************************************************************/
  111.  
  112.     /*
  113.      * Global Variables at negative offsets from the Line A parameter
  114.      * block address returned by init. (I have no way of telling if this
  115.      * list is complete).
  116.      *
  117.      */
  118. /* Name   Offset  Type    Description                         */
  119. /* --------------------------------------------------------------------------*/
  120. /* V_BYTES_LIN -2  W    bytes/line for font                     */
  121. /* V_Y_MAX    -4   W    Max Y pixel value of the screen                 */
  122. /* V_STATUS   -6   W    Text Status byte                     */
  123. /*               Bit    Field        Zero        One         */
  124. /*              0    cursor flash    disabled    enabled         */
  125. /*              1    flash state     off        on         */
  126. /*              2    cursor visible  no        yes          */
  127. /*              3     end of line     no-wrap        wrap         */
  128. /*              4     inverse video   on              off          */
  129. /*                        5     cursor saved    false           true         */
  130. /* V_OFF_AD  -10   L    Font offset table address                 */
  131. /* V_X_MAX   -12   W    Max X pixel value                     */
  132. /* V_FNT_WR  -14   W    Width of Font Form in bytes (see type FONT below)    */
  133. /* V_FNT_ST  -16   W    First font ASCII code (first_ade)             */
  134. /* V_FNT_ND  -18   W    Last  font ASCII code (last_ade )                    */
  135. /* V_FNT_AD  -22   L    Font Form address                     */
  136. /*            Mono Spaced, 8 pixels wide and byte aligned, any ht. */
  137. /* V_CUR_TIM -23   B    Cursor countdown timer                     */
  138. /* V_CUR_CNT -24   B    Cursor flash interval( in frames)             */
  139. /* V_CUR_CY  -26   W    Y cursor position                     */
  140. /* V_CUR_CX  -28   W    X cursor position                     */
  141. /* V_CUR_OFF -30   W    Offset from screen base to first cell (bytes)         */
  142. /* V_CUR_AD  -34   L    Current cursor address                     */
  143. /* V_COL_FG  -36   W    Foreground color index                     */
  144. /* V_COL_BG  -38   W    Background color index                     */
  145. /* V_CEL_WR  -40   W    Offset to next vertical cell (bytes)             */
  146. /* V_CEL_MY  -42   W    Max cells high - 1                     */
  147. /* V_CEL_MX  -44   W    Max cells across - 1                     */
  148. /* V_CEL_HT  -46   W    Cell height in pixels (font form's height)         */
  149. /* --------------------------------------------------------------------------*/
  150.  
  151. /*
  152.  * Atari finally named these variables
  153.  * so here they are
  154.  *
  155.  */
  156. #define V_CEL_HT    (*((short  *)((char  *)__aline + -46L)))
  157. #define V_CEL_MX    (*((short  *)((char  *)__aline + -44L)))
  158. #define V_CEL_MY    (*((short  *)((char  *)__aline + -42L)))
  159. #define V_CEL_WR    (*((short  *)((char  *)__aline + -40L)))
  160. #define V_COL_BG    (*((short  *)((char  *)__aline + -38L)))
  161. #define V_COL_FG    (*((short  *)((char  *)__aline + -36L)))
  162. #define V_CUR_AD    (*((char  **)((char  *)__aline + -34L)))
  163. #define V_CUR_OFF   (*((short  *)((char  *)__aline + -30L)))
  164. #define V_CUR_CX    (*((short  *)((char  *)__aline + -28L)))
  165. #define V_CUR_CY    (*((short  *)((char  *)__aline + -26L)))
  166. #define V_CUR_CNT   (*((char   *)((char  *)__aline + -24L)))
  167. #define V_CUR_TIM   (*(          ((char  *)__aline + -23L)))
  168. #define V_FNT_AD    (*((char  **)((char  *)__aline + -22L)))
  169. #define V_FNT_ND    (*((short  *)((char  *)__aline + -18L)))
  170. #define V_FNT_ST    (*((short  *)((char  *)__aline + -16L)))
  171. #define V_FNT_WR    (*((short  *)((char  *)__aline + -14L)))
  172. #define V_X_MAX     (*((short  *)((char  *)__aline + -12L)))
  173. #define V_OFF_AD    (*((char  **)((char  *)__aline + -10L)))
  174. #define V_STATUS    (*((short  *)((char  *)__aline + -6L)))
  175. #define V_Y_MAX     (*((short  *)((char  *)__aline + -4L)))
  176. #define V_BYTES_LIN (*((short  *)((char  *)__aline + -2L)))
  177.  
  178.      /* more obscure variables again found at negative offset */
  179.  
  180. /* pointer to current font                         */
  181. #define    CUR_FONT    (*((__FONT **)((char *)__aline + -906L)))
  182.  
  183. /* Mouse X hot spot                               */
  184. #define M_POS_HX     (*((short *)((char *)__aline + -856L)))
  185.  
  186. /* Mouse Y hot spot                               */
  187. #define M_POS_HY     (*((short *)((char *)__aline + -854L)))
  188.  
  189. /* writing mode for mouse                        */
  190. #define M_PLANES     (*((short *)((char *)__aline + -852L)))
  191.  
  192. /* mouse bkgd color                                */
  193. #define M_CDB_BG     (*((short *)((char *)__aline + -850L)))
  194.  
  195. /* mouse fgd color                                 */
  196. #define M_CDB_FG     (*((short *)((char *)__aline + -848L)))
  197.  
  198. /* mous form, 32 words alternating words: bkgd-0, fgd-0 ... bkgd-15 fgd-16 */
  199. #define MASK_FORM     ((short *)((char *)__aline + -846L))
  200.                  
  201. /* 45 words of vq_extnd                         */
  202. #define INQ_TAB     ((short *)((char *)__aline + -782L))
  203.  
  204. /* 45 words of v_opnwk                          */
  205. #define DEV_TAB     ((short *)((char *)__aline + -692L))
  206.  
  207. /* current mous X                                */
  208. #define GCURX       (*((short *)((char *)__aline + -602L)))
  209.  
  210. /* current mous Y                                */
  211. #define GCURY       (*((short *)((char *)__aline + -600L)))
  212.  
  213. /* current mous hide cnt                        */
  214. #define M_HID_CT     (*((short *)((char *)__aline + -598L)))
  215.  
  216. /* mous button stat, bit0 = left, 1 = right,  0=up, 1=down          */
  217. #define MOUSE_BT     (*((short *)((char *)__aline + -596L)))
  218.                  
  219. /* 3*16 words of vq_color                         */
  220. #define REQ_COL     ((short *)((char *)__aline + -594L))
  221.  
  222. /* 15 words containing text, line and marker sizes in dev coords
  223.      0 min char width
  224.      1 min char height
  225.      2 max char width
  226.      3 max char height
  227.      4 min line width
  228.      5 reserved
  229.      6 max line width
  230.      7 reserved
  231.      8 min marker width
  232.      9 min marker height
  233.     10 max marker width
  234.     11 max marker height
  235.     12-14  RESERVED                                   */
  236. #define SIZ_TAB     ((short *)((char *)__aline + -498L))
  237.  
  238. /* Pointer to current virtual workstation attributes             */
  239. #define CUR_WORK     (*((short **)((char *)__aline + -464L)))
  240.  
  241. /* -> default font hdr                             */
  242. #define DEF_FONT     (*((__FONT **)((char *)__aline + -460L)) )
  243.  
  244.  
  245. /* FONT_RING is an array of four longword pointers to linked lists of
  246. font headers.  The first entry is the head pointer to the font list,
  247. the second and third are continuation fields, and the fourth is a null
  248. terminator.                                 */
  249. #define FONT_RING     ((short *)((char *)__aline + -456L))
  250.  
  251. /*  Number of fonts in the FONT_RING lists                  */
  252. #define FONT_COUNT     (*((short *)((char *)__aline + -440L)))
  253.  
  254. /* Mouse status
  255.      Bit 0 = left mouse button status  (0=up, 1=down)
  256.      Bit 1 = right mouse button status  (0=up, 1=down)
  257.      Bit 2 = reserved
  258.